package com.my.ouput;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author marshal
 * @date 2021-05-25 8:28 PM
 */
public class FileWriterTest {
    public static void main(String[] args) {
        String path = "file/jingse.txt";
        try (
                var fw = new FileWriter(path);
        ) {
            fw.write("\t\t李商隐-锦瑟\r\n");
            fw.write("锦瑟无端五十弦，一弦一柱思华年。\r\n");
            fw.write("庄生晓梦迷蝴蝶，望帝春心托杜鹃。\r\n");
            fw.write("沧海月明珠有泪，蓝田日暖玉生烟。\r\n");
            fw.write("此情可待成追忆，只是当时已惘然。");
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}
